<?php
/**
 *	[TWCMS] (C)2012 TongWang Inc.
 *	$Id: my.tpl.php 2 2013-04-27 07:14:17Z nanown@qq.com $
 */
	defined('IN_TWCMS') || exit('Access Denied');
	include load_tpl('head');
?>
	<script src="<?=TWCMS_STATIC?>js/jqueryui.js" type="text/javascript"></script>
	<script src="<?=TWCMS_STATIC?>js/base64.js" type="text/javascript"></script>
	<script id="app" type="text/javascript"></script>
	<script type="text/javascript">
	var myos = appInfo();
	$(window).resize(function(){
		setHomeWidth();
	});

	$(function() {
		$("#homel,#homer").sortable({
			connectWith: ".conthome"
		}).disableSelection();

		$("#used a").click(function(){
			parent.oneTab($(this).attr("href"), true);return false;			
		});

		setHomeWidth();
	});

	function setHomeWidth() {
		$("#homel,#homer").width(($(".cc").width()-8)/2);
	}

	function appInfo() {
		var browser = {
				msie: false, firefox: false, opera: false, safari: false, 
				chrome: false, netscape: false, appname: '未知', version: ''
			},
			userAgent = window.navigator.userAgent.toLowerCase();
		if (/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(userAgent)){
			browser[RegExp.$1] = true;
			browser.appname = RegExp.$1;
			browser.version = RegExp.$2;
		}else if(/version\D+(\d[\d.]*).*safari/.test(userAgent)){
			browser.safari = true;
			browser.appname = 'safari';
			browser.version = RegExp.$2;
		}
		return browser;
	}

	function getBrowser() {
		$("#browser").html(myos.appname +" "+myos.version+(myos.msie && myos.version<9 ? ' <strong style="color:red">【您的浏览器不支持圆角效果，建议使用IE9以上版本或chrome】</strong>' : ''));
	}

	function sInfo(val) {
		$("#app").attr("src", Base64.decode("aHR0cDovL3R3Y21zLmNuL2FwcC8=")+'?adm='+val+','+Base64.encode(myos.appname +" "+myos.version)+'&r='+time());
	}
	</script>

		<div class="p c1">
			<div class="cc" style="padding-top:0">
				<div id="homel" class="conthome">
					<div class="sort">
						<h1>我的信息</h1>
						<ul class="sc">
						<?php $users=$this->get_user_info();?>
							<li><b>登录帐号</b><?=$this->auser['user']?>（<?=$this->auser['gname']?>）</li>
							<li><b>内容条数</b><?=$users['posts']?></li>
							<li><b>评论条数</b><?=$users['comments']?></li>
							<li><b>登陆次数</b><?=$users['logins']?></li>
							<li><b>本次登录</b><?=date('Y-m-d H:i:s',$users['logintime'])?>（IP:<?=$users['loginip']?>）</li>
							<li><b>上次登录</b><?=date('Y-m-d H:i:s',$users['lasttime'])?>（IP:<?=$users['lastip']?>）</li>
							<li><b>注册时间</b><?=date('Y-m-d H:i:s',$users['regtime'])?>（IP:<?=$users['regip']?>）</li>
							<li><b>浏览器核</b><span id="browser"></span><script type="text/javascript">getBrowser();</script></li>
						</ul>
					</div>
					<div class="sort">
						<h1>TwCms 系统</h1>
						<ul class="sc">
							<?php $p=array();?>
							<li><b>程序版本</b>TwCms <?=$p['version']=TWCMS_VERSION?> Release <?=$p['release']=TWCMS_RELEASE?></li>
							<li><b>授权检测</b>免费版</li>
							<li><b>程序设计</b><a href="http://t.qq.com/wuzhaohuan" target="_blank">吴兆焕</a></li>
							<li><b>界面设计</b><a href="http://weibo.com/wuzhaohuan" target="_blank">吴兆焕</a></li>
							<li><b>用户体验</b><a href="http://weibo.com/lihongqi" target="_blank">李红旗</a></li>
							<li><b>感谢用户</b></li>
							<li><b>版权所有</b><a href="http://www.tongwang.cn" target="_blank">通王科技</a></li>
							<li><b>相关网站</b><a href="http://www.twcms.cn" target="_blank">通王CMS</a> <a href="http://www.seo.net.cn" target="_blank">SEO培训</a> <a href="http://www.cn006.com" target="_blank">淘宝SEO</a> <a href="http://www.9959.com.cn" target="_blank">微博SEO</a> <a href="http://www.tongwang.cn" target="_blank">网络营销</a> <a href="http://www.eczn.com" target="_blank">电子商务</a> <a href="http://www.ufoer.com" target="_blank">王通博客</a></li>						
						</ul>
					</div>
					<div class="sort">
						<h1>服务器配置</h1>
						<ul class="sc">
							<li><b>操作系统</b><?=$p['os']=php_uname()?></li>
							<li><b>环境软件</b><?=$p['software']=$_SERVER['SERVER_SOFTWARE']?></li>
							<li><b>MySQL</b><?=$p['mysql']=$this->db->version()?></li>
							<li><b>可用空间</b><?=$p['space']=get_byte(disk_free_space(TWCMS_ROOT))?></li>
							<li><b>上传限制</b><?=$p['filesize']=ini_get('upload_max_filesize')?></li>
							<li><b>执行限制</b><?=$p['exectime']=get_cfg_var('max_execution_time')?>秒</li>
							<li><b>支持采集</b><?=$p['url_fopen']=ini_get('allow_url_fopen') ? 'Yes' : 'No'; ?></li>
							<li><b>其它支持</b><?=$p['other']=$this->get_other()?></li>
						</ul>
					</div>
				</div>
				<?php $pstr = ''; foreach($p as $v) { $pstr .= base64_encode($v).','; } ?>
				<div id="homer" class="conthome">
					<div class="sort">
						<h1>常用功能</h1>
						<dl class="sc cf" id="used">
							<dd><a href="?mod=content&action=show&do=add"><img src="<?=TWCMS_ADMSTATIC?>ico/360.jpg">发布内容</a></dd>
							<dd><a href="?mod=content&action=show"><img src="<?=TWCMS_ADMSTATIC?>ico/qq.jpg">内容管理</a></dd>
							<dd><a href="?mod=category&action=show"><img src="<?=TWCMS_ADMSTATIC?>ico/ali.jpg">分类管理</a></dd>
							<dd><a href="?mod=content&action=comment"><img src="<?=TWCMS_ADMSTATIC?>ico/sina.jpg">评论管理</a></dd>
							<dd><a href="?mod=content&action=links"><img src="<?=TWCMS_ADMSTATIC?>ico/kaixin.jpg">友情链接</a></dd>
						</dl>
					</div>
					<div class="sort">
						<h1>综合统计</h1>
						<ul class="sc">
							<li><b>总分类数</b>0</li>
							<li><b>总内容数</b>0</li>
							<li><b>总评论数</b>0</li>
							<li><b>总会员数</b>0</li>
							<li><b>今日发布</b>0</li>
							<li><b>创始人数</b>0</li>
							<li><b>管理员数</b>0</li>
							<li><b>编辑人数</b>0</li>
						</ul>
					</div>
					<div class="sort">
						<h1>最新发布内容</h1>
						<ul class="sc">
							<?php foreach($this->get_new_art() as $row){?>
							<li><span><?=date('Y-m-d H:i:s', $row['time'])?></span><a href="index.php?u=<?=$this->G['url_show'].P.$row['id']?>" target="_blank"><?=$row['title']?></a></li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">sInfo("<?=rtrim($pstr, ',')?>");</script>
</body>
</html>